<?php
/**
* @package      auto_occasion
* @subpackage   admin
* @author       CMS
* @copyright    2011
* @license      All rights reserved
*/

require_once (JELIX_LIB_CORE_PATH.'response/jResponseHtml.class.php');

class adminHtmlResponse extends jResponseHtml {

    //Menu
    const MENU_OPERATEURS       = 1;
    const MENU_ANNONCES         = 2;
    const MENU_TARIFS           = 3;
    const MENU_ILLUSTRATIONS    = 4;
    const MENU_LIENS_UTILES     = 5;
    const MENU_TEMOIGNAGE       = 6;
    const MENU_PARTENAIRE       = 7;
    const MENU_PUB              = 8;
    const MENU_ACTU             = 9;
    const MENU_ENTREPRISE       = 10;
    const MENU_STATISTIQUE      = 11;
    const MENU_MARQUE_MODELE    = 12;
    const MENU_FICHES_MODELES   = 13;
    const MENU_FICHES_GAMMES    = 14;
    const MENU_FICHES_DOSSIERS  = 15;
    const MENU_PARUTION         = 16;

    /**
    * Menu actif
    */
    var $menusActifs;

    function __construct() {
        parent::__construct();

        $this->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/css/niceforms-default.css');
        $this->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/css/common.css');
        $this->addCSSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/css/style.css');

        
        $this->addJSCode("var j_basepath = '" . $GLOBALS['gJConfig']->urlengine['basePath'] . "';");

        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/niceforms.js');
        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/clockp.js');
        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/jquery-1.5.1.js');
        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/ddaccordion.js');
        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/jquery.ui.datepicker.js');
        $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'design/back/js/jquery.localisation-min.js');
    }

    protected function doAfterActions() {
         global $gJCoord;

        //print_r($this->params);

        $this->title = "Auto Occasion - Console d'administration";
        if (!isset($this->menusActifs)) {
            throw new Exception("Les menus actifs de la réponse HTML adminHtml doivent etre definit");
        }

        if ($this->menusActifs != self::MENU_TARIFS)
            $this->addJSLink($GLOBALS['gJConfig']->urlengine['basePath'].'ckeditor/ckeditor.js');

        //Header et footer - top menu
        $this->body->assignZone('oZoneHeader', 'commun~BoHeader');
        $this->body->assignZone('oZoneLeftMenu', 'commun~BoLeftMenu');
        $this->body->assignZone('oZoneTopMenu', 'commun~BoTopMenu', array ('menusActifs' => $this->menusActifs));

    }

}
